package com.sie.project.controller;

import com.sie.project.entity.Project;
import com.sie.project.entity.ProjectSelectVo;
import com.sie.project.service.ProjectService;
import com.sie.project.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author linjinde
 */
@RestController
public class TestController {
    @Autowired
    ProjectService projectService;
    @GetMapping("/hello")
    public String hello(@RequestParam(value = "name", defaultValue = "World") String name) {
        return String.format("Hello %s!", name);
    }

    @GetMapping("/test")
    public String getProjects() {
        List<Project> saleProject = projectService.getProjectsByType("Sale Project");
        for (Project project : saleProject){
            System.out.println(project);
        }
        return "";
    }

}
